<template>
    <view class="">
        <block v-if="isConnected"><slot></slot></block>
        <block v-else>
            <view class="net-error"></view>
            <view class="net-error-span">网络错误,请检查网络是否正确</view>
        </block>
    </view>
</template>

<script>
export default {
    props: {
        isConnected: {
            type: Boolean,
            default: true
        }
    }
};
</script>

<style>
   .net-error {
       background: url("")
           center center no-repeat rgba(245, 245, 245, 0.05);
       background-size: 40%;
       position: fixed;
       z-index: 999999;
       width: 100%;
       height: 70vh;
       line-height: 100%;
       top: 0;
       left: 0;
       bottom: 0px;
   }
   .net-error-span{
       position: fixed;
       z-index: 999999;
       bottom: 10vh;
       width: 100%;
       margin: 0 auto;
       text-align: center;
       font-size: 17px;
       color: #9d9d9d;
   }
</style>
